package com.bw.liuyushan.zhuangao4_weektest2.Adapter;

import android.widget.ImageView;

import com.bumptech.glide.Glide;
import com.bw.liuyushan.zhuangao4_weektest2.Entity.GiftBean;
import com.bw.liuyushan.zhuangao4_weektest2.R;
import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.viewholder.BaseViewHolder;

import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;

import java.util.List;

/**
 * ZhuanGao4_WeekTest2
 * file name is : GiftAdapter
 * created by Ender on 2021/8/25 17:08.
 * author : 刘雨杉
 * Describe(作用):
 */
public class GiftAdapter extends BaseQuickAdapter<GiftBean.DataBean, BaseViewHolder> {
    public GiftAdapter(@Nullable List<GiftBean.DataBean> data) {
        super(R.layout.popugift, data);
        addChildClickViewIds(R.id.gifts);
    }

    @Override
    protected void convert(@NotNull BaseViewHolder baseViewHolder, GiftBean.DataBean dataBean) {
        Glide.with(getContext()).load(dataBean.getGifImg()).into((ImageView) baseViewHolder.findView(R.id.img_popu));
        baseViewHolder.setText(R.id.tv_popu,dataBean.getName());
        baseViewHolder.setText(R.id.tvmoney_popu, String.valueOf(dataBean.getPrice()));
    }
}
